package com.oocl.message.sender;

import java.io.IOException;
import java.io.PrintWriter;

import org.json.JSONObject;

import com.oocl.chatroom.network.protocol.Message;

public class MsgSender {

	
	private PrintWriter out;

	public MsgSender(PrintWriter out) {
		super();
		this.out = out;
	}
	
	public void send(Message msg) throws IOException{
		JSONObject jOb=new JSONObject(msg);
		String json=jOb.toString();
		out.println(json);
		out.flush();
	}
}
